

    const userDao = require('../dao/userDao.js')
    const encryption = require('../lib/encryption')

    module.exports = {

        loginGetToken: async (username, password) => {
            password = await encryption.getMd5Pass(password)
            // console.log(await userDao.sequelizelogin(username, password))
            let data = await userDao.sequelizelogin(username, password)
            return data.data
        },

        getUserInfoById: async (userid) => {
            let userinfo = await userDao.returnUserInfo()
            for(let x in userinfo) {
                if(userinfo[x].id === userid) return userinfo[x]
            }
        }

    }